package com.xiaxiang.xiawan.NetBean;

import com.google.gson.Gson;

public class UpdateNetBean{

    /**
     * code : 200
     * content : {"addTime":"2017-11-13 16:19:13","apkFileUrl":"https://raw.githubusercontent.com/WVector/AppUpdateDemo/master/apk/app-debug.apk","constraint":1,"deleteStatus":0,"id":28,"newMd5":"78d9b923410f342c691c4dc4f68b42c5","newVersion":"65756","tails":{},"targetSize":"11.1797","update":1,"updateLog":"5675"}
     */

    private int code;
    private ContentEntity content;

    public static UpdateNetBean objectFromData(String str) {

        return new Gson().fromJson(str, UpdateNetBean.class);
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setContent(ContentEntity content) {
        this.content = content;
    }

    public int getCode() {
        return code;
    }

    public ContentEntity getContent() {
        return content;
    }

    public static class ContentEntity {
        /**
         * addTime : 2017-11-13 16:19:13
         * apkFileUrl : https://raw.githubusercontent.com/WVector/AppUpdateDemo/master/apk/app-debug.apk
         * constraint : 1
         * deleteStatus : 0
         * id : 28
         * newMd5 : 78d9b923410f342c691c4dc4f68b42c5
         * newVersion : 65756
         * tails : {}
         * targetSize : 11.1797
         * update : 1
         * updateLog : 5675
         */

        private String addTime;
        private String apkFileUrl;
        private int constraint;
        private int deleteStatus;
        private int id;
        private String newMd5;
        private String newVersion;
        private String targetSize;
        private int update;
        private String updateLog;

        public static ContentEntity objectFromData(String str) {

            return new Gson().fromJson(str, ContentEntity.class);
        }

        public void setAddTime(String addTime) {
            this.addTime = addTime;
        }

        public void setApkFileUrl(String apkFileUrl) {
            this.apkFileUrl = apkFileUrl;
        }

        public void setConstraint(int constraint) {
            this.constraint = constraint;
        }

        public void setDeleteStatus(int deleteStatus) {
            this.deleteStatus = deleteStatus;
        }

        public void setId(int id) {
            this.id = id;
        }

        public void setNewMd5(String newMd5) {
            this.newMd5 = newMd5;
        }

        public void setNewVersion(String newVersion) {
            this.newVersion = newVersion;
        }

        public void setTargetSize(String targetSize) {
            this.targetSize = targetSize;
        }

        public void setUpdate(int update) {
            this.update = update;
        }

        public void setUpdateLog(String updateLog) {
            this.updateLog = updateLog;
        }

        public String getAddTime() {
            return addTime;
        }

        public String getApkFileUrl() {
            return apkFileUrl;
        }

        public int getConstraint() {
            return constraint;
        }

        public int getDeleteStatus() {
            return deleteStatus;
        }

        public int getId() {
            return id;
        }

        public String getNewMd5() {
            return newMd5;
        }

        public String getNewVersion() {
            return newVersion;
        }

        public String getTargetSize() {
            return targetSize;
        }

        public String getUpdate() {
            if (update == 1){
                return "YES";
            }else {
                return "NO";
            }
        }

        public String getUpdateLog() {
            return updateLog;
        }
    }
}